package com.ymatou.iapi.login.service;

import java.util.Map;

import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymttest.utils.EnvSetup;
/**
*创建YMT微信用户接口Call
*FreeMaker Template自动生成代码
*/
public class WeiXinUserRequestDtoCall extends YmatouBaseCall{
	private static String opurl ="json/reply/WeiXinUserRequestDto";
	
	public WeiXinUserRequestDtoCall() {
		super(EnvSetup.getSystemUrl("login_iapi"),opurl,"POST","JSON");
	}
	
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public Map getResult(){
		Map result = (Map) FormatUtil.GSONToObject(getString("Result"), Map.class);
		return result;
	} 
	public Integer getUid(){
		Integer uid=getJsonObject().get("Result").getAsJsonObject().get("UserId").getAsInt();
		return uid;
	} 
}